package cn.emall.controller;

import cn.emall.pojo.EasyUITreeNode;
import cn.emall.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Controller
 */
@Controller
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    @RequestMapping(value = "/item/cat/list")
    @ResponseBody
    public List<EasyUITreeNode> getTreeNode(
            @RequestParam(name = "id",defaultValue = "0")Long parentId){
        //调用服务查询节点列表
        List<EasyUITreeNode> list = itemCatService.getItemCatList1(parentId);
        return list;
    }
}
